import React from 'react';
import PropTypes from 'prop-types';
import ChildrenComp from './Children'
//Context可以让我们无须明确地传遍每一个组件，就能将值深入传递进组件树。
//为当前的testContext 创建一个context（“hello”额外i默认值）
const TestContext = React.createContext('111');

export default class Index extends React.Component {
    constructor(props) {
        super(props);
    }

    render() {
        return (
            <TestContext.Provider value="hello world">
                <MiddleWare />
            </TestContext.Provider>
        )
    }
}

function MiddleWare(props) {
    return (
        <div>
            <ChildrenComp />
        </div>
    )
}

